package one.bugu.android.demon.ui.activity;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.juefeng.android.framework.common.util.ToastUtils;
import com.juefeng.android.framework.view.annotation.LKContentView;
import com.juefeng.android.framework.view.annotation.LKInjectView;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;


import one.bugu.android.demon.MyApplication;
import one.bugu.android.demon.R;
import one.bugu.android.demon.common.MyBaseActivity;
import one.bugu.android.demon.util.IntentUtils;
import one.bugu.android.demon.util.StatusBarUtils;
import one.bugu.android.demon.util.WeChatUtils;

@LKContentView(R.layout.activity_main)
public class MainActivity extends MyBaseActivity {

    @LKInjectView(R.id.rl_main_container)
    private RelativeLayout mRlMainContainer;

    @LKInjectView(R.id.ll_weixin_login)
    private LinearLayout mLlWeixinLogin;

    @LKInjectView(R.id.ll_tel_login)
    private LinearLayout mLlTelLogin;

    @Override
    protected void initView() {
        super.initView();
        //设置状态栏
        StatusBarUtils.getInstance().setStatusBar(MainActivity.this, mRlMainContainer);

    }

    @Override
    protected void initData() {
        super.initData();

        MyApplication.addActivity(this);
    }

    @Override
    protected void initEvent() {
        super.initEvent();

        mLlWeixinLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WeChatUtils.getInstance().loginWeixin(MyApplication.mWxApi);

            }
        });

        mLlTelLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                IntentUtils.startAty(MainActivity.this, TelLoginActivity.class);

            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        MyApplication.removeActivity(this);
    }
}
